Optimal. Leaf size=78 \[ \frac{1}{6} b^3 \cos (a) \text{CosIntegral}\left (\frac{b}{x}\right )-\frac{1}{6} b^3 \sin (a) \text{Si}\left (\frac{b}{x}\right )-\frac{1}{6} b^2 x \sin \left (a+\frac{b}{x}\right )+\frac{1}{3} x^3 \sin \left (a+\frac{b}{x}\right )+\frac{1}{6} b x^2 \cos \left (a+\frac{b}{x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.131339, antiderivative size = 78, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.417, Rules used = {3379, 3297, 3303, 3299, 3302} \[ \frac{1}{6} b^3 \cos (a) \text{CosIntegral}\left (\frac{b}{x}\right )-\frac{1}{6} b^3 \sin (a) \text{Si}\left (\frac{b}{x}\right )-\frac{1}{6} b^2 x \sin \left (a+\frac{b}{x}\right )+\frac{1}{3} x^3 \sin \left (a+\frac{b}{x}\right )+\frac{1}{6} b x^2 \cos \left (a+\frac{b}{x}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3379
Rule 3297
Rule 3303
Rule 3299
Rule 3302
Rubi steps
\begin{align*} \int x^2 \sin \left (a+\frac{b}{x}\right ) \, dx &=-\operatorname{Subst}\left (\int \frac{\sin (a+b x)}{x^4} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{3} x^3 \sin \left (a+\frac{b}{x}\right )-\frac{1}{3} b \operatorname{Subst}\left (\int \frac{\cos (a+b x)}{x^3} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{6} b x^2 \cos \left (a+\frac{b}{x}\right )+\frac{1}{3} x^3 \sin \left (a+\frac{b}{x}\right )+\frac{1}{6} b^2 \operatorname{Subst}\left (\int \frac{\sin (a+b x)}{x^2} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{6} b x^2 \cos \left (a+\frac{b}{x}\right )-\frac{1}{6} b^2 x \sin \left (a+\frac{b}{x}\right )+\frac{1}{3} x^3 \sin \left (a+\frac{b}{x}\right )+\frac{1}{6} b^3 \operatorname{Subst}\left (\int \frac{\cos (a+b x)}{x} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{6} b x^2 \cos \left (a+\frac{b}{x}\right )-\frac{1}{6} b^2 x \sin \left (a+\frac{b}{x}\right )+\frac{1}{3} x^3 \sin \left (a+\frac{b}{x}\right )+\frac{1}{6} \left (b^3 \cos (a)\right ) \operatorname{Subst}\left (\int \frac{\cos (b x)}{x} \, dx,x,\frac{1}{x}\right )-\frac{1}{6} \left (b^3 \sin (a)\right ) \operatorname{Subst}\left (\int \frac{\sin (b x)}{x} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{6} b x^2 \cos \left (a+\frac{b}{x}\right )+\frac{1}{6} b^3 \cos (a) \text{Ci}\left (\frac{b}{x}\right )-\frac{1}{6} b^2 x \sin \left (a+\frac{b}{x}\right )+\frac{1}{3} x^3 \sin \left (a+\frac{b}{x}\right )-\frac{1}{6} b^3 \sin (a) \text{Si}\left (\frac{b}{x}\right )\\ \end{align*}
Mathematica [A] time = 0.073134, size = 70, normalized size = 0.9 \[ \frac{1}{6} \left (b^3 \cos (a) \text{CosIntegral}\left (\frac{b}{x}\right )-b^3 \sin (a) \text{Si}\left (\frac{b}{x}\right )+x \left (b^2 \left (-\sin \left (a+\frac{b}{x}\right )\right )+2 x^2 \sin \left (a+\frac{b}{x}\right )+b x \cos \left (a+\frac{b}{x}\right )\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.012, size = 73, normalized size = 0.9 \begin{align*} -{b}^{3} \left ( -{\frac{{x}^{3}}{3\,{b}^{3}}\sin \left ( a+{\frac{b}{x}} \right ) }-{\frac{{x}^{2}}{6\,{b}^{2}}\cos \left ( a+{\frac{b}{x}} \right ) }+{\frac{x}{6\,b}\sin \left ( a+{\frac{b}{x}} \right ) }+{\frac{\sin \left ( a \right ) }{6}{\it Si} \left ({\frac{b}{x}} \right ) }-{\frac{\cos \left ( a \right ) }{6}{\it Ci} \left ({\frac{b}{x}} \right ) } \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 1.14623, size = 116, normalized size = 1.49 \begin{align*} \frac{1}{12} \,{\left ({\left ({\rm Ei}\left (\frac{i \, b}{x}\right ) +{\rm Ei}\left (-\frac{i \, b}{x}\right )\right )} \cos \left (a\right ) +{\left (i \,{\rm Ei}\left (\frac{i \, b}{x}\right ) - i \,{\rm Ei}\left (-\frac{i \, b}{x}\right )\right )} \sin \left (a\right )\right )} b^{3} + \frac{1}{6} \, b x^{2} \cos \left (\frac{a x + b}{x}\right ) - \frac{1}{6} \,{\left (b^{2} x - 2 \, x^{3}\right )} \sin \left (\frac{a x + b}{x}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.04289, size = 224, normalized size = 2.87 \begin{align*} -\frac{1}{6} \, b^{3} \sin \left (a\right ) \operatorname{Si}\left (\frac{b}{x}\right ) + \frac{1}{6} \, b x^{2} \cos \left (\frac{a x + b}{x}\right ) + \frac{1}{12} \,{\left (b^{3} \operatorname{Ci}\left (\frac{b}{x}\right ) + b^{3} \operatorname{Ci}\left (-\frac{b}{x}\right )\right )} \cos \left (a\right ) - \frac{1}{6} \,{\left (b^{2} x - 2 \, x^{3}\right )} \sin \left (\frac{a x + b}{x}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \sin{\left (a + \frac{b}{x} \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \sin \left (a + \frac{b}{x}\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]